package day20171215;

import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MyTest {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<String, Integer>();
        String path = "C:\\Users\\Administrator\\Desktop\\java";
        try {
            BufferedReader reader = new BufferedReader(new FileReader(path));

            String sno = null;

            while ((sno = reader.readLine()) != null){
                map.put(sno,0);
            }
            File file = new File("D:\\");

            File [] files = file.listFiles();
            for (File f : files){
                String fileName = f.getName();
                Matcher matcher = Pattern.compile("信本1班(\\d+)胡干航")
                        .matcher(fileName);

                while (matcher.find()){
                    System.out.println(matcher.group(1));
                }


            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
